Grokking System Design Fundamentals
Rate this course
Ask Author
Contribute
Back to course home

98% completed

Vote For New Content
System Design Fundamentals
Introduction to System Design
Load Balancing
Introduction to Load Balancing
Load Balancing Algorithms
Uses of Load Balancing
Load Balancer Types
Stateless vs. Stateful Load Balancing
High Availability and Fault Tolerance
Scalability and Performance
Challenges of Load Balancers
API Gateway
Introduction to API Gateway
Usage of API gateway
Advantages and disadvantages of using API gateway
Key Characteristics of Distributed Systems
Scalability
Availability
Latency and Performance
Concurrency and Coordination
Monitoring and Observability
Resilience and Error Handling
Fault Tolerance vs. High Availability
Network Essentials
HTTP vs. HTTPS
TCP vs. UDP
HTTP: 1.0 vs. 1.1 vs 2.0 vs. 3.0
URL vs. URI vs. URN
Domain Name System (DNS)
Introduction to DNS
DNS Resolution Process
DNS Load Balancing and High Availability
Caching
Introduction to Caching
Why is Caching Important?
Types of Caching
Cache Replacement Policies
Cache Invalidation
Cache Read Strategies
Cache Coherence and Consistency Models
Caching Challenges
Cache Performance Metrics
CDN
What is CDN?
Origin Server vs. Edge Server
CDN Architecture
Push CDN vs. Pull CDN
Data Partitioning
Introduction to Data Partitioning
Partitioning Methods
Data Sharding Techniques
Benefits of Data Partitioning
Common Problems Associated with Data Partitioning
Proxies
What is a Proxy Server?
Uses of Proxies
VPN vs. Proxy Server
Redundancy and Replication
What is Redundancy?
What is Replication?
Replication Methods
Data Backup vs. Disaster Recovery
CAP & PACELC Theorems
Introduction to CAP Theorem
Components of CAP Theorem
Trade-offs in CAP Theorem
Examples of CAP Theorem in Practice
Beyond CAP Theorem
System Design Trade-offs in Interviews
Databases (SQL vs. NoSQL)
Introduction to Databases
SQL Databases
NoSQL Databases
SQL vs. NoSQL
ACID vs BASE Properties
Real-World Examples and Case Studies
SQL Normalization and Denormalization
In-Memory Database vs. On-Disk Database
Data Replication vs. Data Mirroring
Database Federation
Indexes
What are Indexes?
Types of Indexes
Bloom Filters
Introduction to Bloom Filters
Benefits & Limitations of Bloom Filters
Variants and Extensions of Bloom Filters
Applications of Bloom Filters
Long-Polling vs. WebSockets vs. Server-Sent Events
Difference Between Long-Polling, WebSockets, and Server-Sent Events
Quorum
What is Quorum?
Heartbeat
What is Heartbeat?
Checksum
What is Checksum?
Uses of Checksum
Leader and Follower
What is Leader and Follower Pattern?
Security
What is Security and Privacy?
What is Authentication?
What is Authorization?
Authentication vs. Authorization
OAuth vs. JWT for Authentication
What is Encryption?
What are DDoS Attacks?
Distributed Messaging System
Introduction to Messaging System
Introduction to Kafka
Messaging patterns
Popular Messaging Queue Systems
RabbitMQ vs. Kafka vs. ActiveMQ
Scalability and Performance
Distributed File Systems
What is a Distributed File System?
Architecture of a Distributed File System
Key Components of a DFS
Misc Concepts
Batch Processing vs. Stream Processing
XML vs. JSON
Synchronous vs. Asynchronous Communication
Push vs. Pull Notification Systems
Microservices vs. Serverless Architecture
Message Queues vs. Service Bus
Stateful vs. Stateless Architecture
Event-Driven vs. Polling Architecture
Quiz
Event-Driven vs. Polling Architecture

Event-Driven and Polling architectures represent two different approaches to monitoring and responding to changes or new data in software systems. Each has its characteristics, benefits, and best use cases.

Event-Driven Architecture

Definition

  • Event-Driven Architecture is a design pattern in which a component executes in response to receiving one or more event notifications. Events are emitted by a source (like user actions or system triggers), and event listeners or handlers react to these events.

Characteristics

  • Reactive: The system reacts to events as they occur.
  • Asynchronous: Event handling is typically non-blocking and asynchronous.
  • Loose Coupling: The event producers and consumers are loosely coupled, enhancing flexibility and scalability.
  • Real-Time Processing: Ideal for scenarios requiring immediate action in response to changes.

Use Cases

  • Real-time user interfaces, where user actions trigger immediate system responses.
  • Complex event processing in distributed systems.
  • Implementing microservices communication via message brokers like Kafka or RabbitMQ.

Example

  • In a smart home system, a temperature sensor detects a change in room temperature and emits an event. The heating system subscribes to these events and reacts by adjusting the temperature.

Polling Architecture

Definition

  • Polling Architecture involves a design where a component frequently checks (polls) a source to detect if any new data or change in state has occurred, and then acts on the change.

Characteristics

  • Active Checking: The system regularly queries or checks a source for changes.
  • Synchronous: Polling is often a synchronous and blocking operation.
  • Simple to Implement: Easier to implement than event-driven systems but can be less efficient.
  • Predictable Load: The polling interval sets a predictable load on the system.

Use Cases

  • Checking for new emails or updates in applications where real-time processing is not critical.
  • Monitoring system status or performing routine checks where events are infrequent.

Example

  • A backup software that checks every 24 hours to see if new files need to be backed up.

Key Differences

  1. Response to Changes:

    • Event-Driven: Responds immediately to events as they occur.
    • Polling: Checks for changes at regular intervals.
  2. Resource Utilization:

    • Event-Driven: Generally more efficient with system resources, as it only reacts to changes.
    • Polling: Can be resource-intensive, especially with frequent polling intervals.
  3. Complexity:

    • Event-Driven: Can be more complex to implement, requiring robust event handling and management.
    • Polling: Simpler to implement but may not be as responsive or efficient.
  4. Real-Time Capability:

    • Event-Driven: Suitable for real-time applications.
    • Polling: More suitable for applications where real-time response is not critical.
  5. Scalability:

    • Event-Driven: Scales well, especially in distributed systems with many events.
    • Polling: Scaling can be challenging, particularly if the polling frequency is high.

Conclusion

Choosing between event-driven and polling architectures depends on the specific requirements of the application. Event-driven architectures are ideal for systems where immediate responsiveness to changes is critical, and efficiency and scalability are important. Polling architectures, while simpler, are best suited for scenarios where events are less frequent or real-time responsiveness is not a necessity.

Stateful vs. Stateless Architecture
Quiz
Mark as Completed

On this page

Event-Driven Architecture

Definition

Characteristics

Use Cases

Example

Polling Architecture

Definition

Characteristics

Use Cases

Example

Key Differences

Conclusion